#include "widget.h"
#include "ui_widget.h"
#include <QPainter>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::paintEvent(QPaintEvent *event)
{
    (void) event;
    QPainter painter(this);

    //painter.translate(100, 100); //设置图片位置，左上角

    //从(0, 0) 开始画图，图片尺寸和原图一样
    painter.drawPixmap(0, 0, QPixmap(":/deepseek.png"));

    //从(300, 400) 开始画图，尺寸变为50 * 60
    painter.drawPixmap(300, 400, 50, 60, QPixmap(":/deepseek.png"));
}

